﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TopicTree.aspx.cs" Inherits="Manage_TopicTree" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>选择栏目</title>
    <style type="text/css">
        a, a:hover
        {
            text-decoration: none;
        }

        a.selected
        {
            color: #ff00ff;
        }
    </style>
    <script src="../js/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script type="text/javascript">
        var rtnVal = '|';
        $(document).ready(function () {
            window.returnValue = rtnVal;

            $('input#CloseWindow').click(function () {
                window.returnValue = rtnVal;
                window.close();

                return false;
            });

            $('a').each(function () {
                var href = $(this).attr('href');
                if (href == null) {
                    return true;
                }

                var id = href.substring(href.indexOf("'") + 1, href.lastIndexOf("'"));
                if (id == null) {
                    return true;
                }

                $(this).attr('href', 'javascript:void(0);');
                $(this).click(function () {
                    $('a.selected').removeClass('selected');
                    $(this).addClass('selected');

                    rtnVal = (id == '0' ? '' : id) + '|' + $(this).html();
                });
            });
        });
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:TreeView ID="TreeView1" runat="server" ShowLines="true" ShowExpandCollapse="true"></asp:TreeView>
    </div>
    <div style="text-align: center">
        <asp:Button ID="CloseWindow" ClientIDMode="Static" runat="server" Text="确定" />
    </div>
    </form>
</body>
</html>
